package com.jblv.frame.common.fastdfs.image;

import java.util.ArrayList;
import java.util.List;

/**
 * @author happyonion.yangtao
 * @version 1.0
 * @title CommonPictureSizeType
 * @projectName jblv-frame
 * @packageName com.jblv.common.fastdfs.image
 * @description CommonPictureSizeType
 * @date Create at 2020/5/7 11:05
 * @since jdk1.8
 */


public enum CommonPictureSizeType {
    SIZE_240_240("_240_240", 240, 240),
    SIZE_4_3("_ORIGINAL_4_3", 435, 326),
    SIZE_ORIGINAL("_ORIGINAL_", 700, 800),
    SIZE_48_48("_48_48", 48, 48),
    SIZE_80_80("_80_80", 80, 80),
    SIZE_96_96("_96_96", 96, 96),
    SIZE_144_144("_144_144", 144, 144),
    SIZE_200_200("_200_200", 200, 200),
    SIZE_220_220("_220_220", 220, 220),
    SIZE_380_285("_380_285", 380, 285),
    SIZE_640_406("_640_406", 640, 406),
    SIZE_720_230("_720_230", 720, 330),
    SIZE_16_9("_ORIGINAL_16_9", 720, 405);

    private int height;
    private int width;
    private String sizeName;

    private CommonPictureSizeType(String sizename, int width, int height) {
        this.height = height;
        this.width = width;
        this.sizeName = sizename;
    }

    public String getSizeName() {
        return this.sizeName;
    }

    public void setSizeName(String sizeName) {
        this.sizeName = sizeName;
    }

    public int getHeight() {
        return this.height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWidth() {
        return this.width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public static List<PicSize> getPicSize() {
        List<PicSize> list = new ArrayList();
        CommonPictureSizeType[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            CommonPictureSizeType piceSize = var1[var3];
            list.add(new PicSize(piceSize.width, piceSize.height, piceSize.sizeName));
        }

        return list;
    }

    public static PicSize getPicSize(CommonPictureSizeType piceSize) {
        return new PicSize(piceSize.width, piceSize.height, piceSize.sizeName);
    }
}

